package com.qianbao.dao.sms;

import com.qianbao.domain.sms.SVSmsEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface SVSmsDao {


    @Select("select * from sms_send_info")
    public List<SVSmsEntity> findAll();


    @Insert("insert into sms_send_info(id,phone,sign,template_code,params,create_time,update_time) " +
            "values (#{id},#{phone},#{sign},#{template_code},#{params},#{create_time},#{update_time})")
    public int saveSms(SVSmsEntity entity);


    @Select("select params from sms_send_info where phone = #{phone} order by create_time desc limit 1")
    public String findCodeByPhone(String phone);


}
